/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wiView.console;

import javax.swing.AbstractButton;
import javax.swing.ButtonModel;
import wiView.graphics.UI.GraphForm;

/**
 *
 * @author brother
 */
public class ConsoleConnecter {

    GraphForm display;
    wisimconsole.WiSimConsole console;

    public ConsoleConnecter(GraphForm display, wisimconsole.WiSimConsole console, boolean showConsole) {
	this.display = display;
	this.console = console;
	console.getConsole().setVisible(showConsole);
    }

    public void checkBoxChange(javax.swing.event.ChangeEvent evt) {
	AbstractButton abstractButton = (AbstractButton) evt.getSource();
	ButtonModel buttonModel = abstractButton.getModel();
	boolean armed = buttonModel.isArmed();
	boolean pressed = buttonModel.isPressed();
	if (pressed) {
	    boolean selected = buttonModel.isSelected();
	    console.getConsole().setVisible(selected);
	}
    }
}
